<?php
/**
 * basic_adminController
 *
 * @version:	0.1a
 * @package:	global
 * @author: 	alex_ez
 * @created:	28.03.2010 16:52
 *
 * @copyright:	(c) 2010 alex <qfox@ya.ru> yaroshevich aka alex_ez. All rights reserved.
 */


abstract class basic_adminController extends controller
{
	public function onstart( )
	{
		$this ->visitor = visitor::__getMe( );
		$this ->visitor ->needAuth( 'admin', true );
		$this ->frame = 'admin/!index.tpl';
	}
	
	public function showIndexPage( $p, $o )
	{
		return texo::translate( 'You have reached admin/index page. Please write showIndexPage in your admin controller.' );
	}
	
	public function fullmenuBlock( $p )
	{
		if( !isset( $p['_'] ) )
			$p['_'] = array( );
		
		$o = array( );
		$o['extends'] = 'adminController';
		$o['suffix'] = 'AdminController';
		$o['listcallback'] = 'getAdminControllers';
		$o['urlbase'] = '/admin/';
		
		$p['_'] += $o;
		$p['mode'] = _::pick( @$p['mode'], 'drops' );
		
		return parent::fullmenuBlock( $p );
	}
}

?>